Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature/PDOAAC-6302] (issue/137) add in small notificaiton on using -gr flag #179

Merged
merged 10 commits into from
Mar 13, 2025

Conversation

hkryeung
Copy link

@hkryeung hkryeung commented Mar 6, 2025

Throwing in a small notification when -gr flag is used and no results have returned
looks like follows

> podaac-data-downloader -c OSCAR_L4_OC_third-deg -d . -gr="oscar_vel11181.nc.gz" -e nc.gz
[2025-03-06 10:38:36,069] {podaac_data_downloader.py:284} INFO - ** 0 granules found with -gr (granuleUR) flag.            **
[2025-03-06 10:38:36,070] {podaac_data_downloader.py:285} INFO - ** If you expected granules to be found and downloaded,   **
[2025-03-06 10:38:36,070] {podaac_data_downloader.py:286} INFO - ** please try using wildcards (*/%) in the -gr parameter. **
[2025-03-06 10:38:36,070] {podaac_data_downloader.py:287} INFO - **    -gr="*data*" for multiple characters                **
[2025-03-06 10:38:36,070] {podaac_data_downloader.py:288} INFO - **    -gr="_A%T_" for a single character                  **
[2025-03-06 10:38:36,070] {podaac_data_downloader.py:324} INFO - Found 0 total files to download
[2025-03-06 10:38:36,070] {podaac_data_downloader.py:376} INFO - Downloaded Files: 0
[2025-03-06 10:38:36,070] {podaac_data_downloader.py:377} INFO - Failed Files:     0
[2025-03-06 10:38:36,070] {podaac_data_downloader.py:378} INFO - Skipped Files:    0
[2025-03-06 10:38:36,070] {podaac_data_downloader.py:177} INFO - Success Count: 0
[2025-03-06 10:38:36,071] {podaac_data_downloader.py:186} INFO - END

@hkryeung hkryeung requested review from mike-gangl and yenes56 March 6, 2025 00:04
@@ -280,6 +280,9 @@ def cmr_downloader(args, token, data_path):
if args.verbose:
logging.info(str(results['hits']) + " granules found for " + short_name) # noqa E501

if granule is not None and results['hits'] == 0:
logging.info("** 0 granules found with -gr (granuleUR) flag; tried using wildcards (*/%)? **")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a user may takes this one of two ways:

  1. are you attempting to use wild cards?
  2. have you tried using wild cards here? it might be helpful?

Recommend changing this to something clearer:

0 granules found with -gr (granuleUR) flag; You may want to try using wildcards (*/%) in the granuleUR?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha; updated formatting and wording
Screenshot 2025-03-06 at 10 40 10

Copy link
Collaborator

@mike-gangl mike-gangl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'help message' might be confusing to users. recommend changing that a bit.

@hkryeung hkryeung requested review from mike-gangl and yenes56 March 6, 2025 16:40
@mike-gangl
Copy link
Collaborator

What's going on with the tests?

@hkryeung
Copy link
Author

hkryeung commented Mar 6, 2025

@mike-gangl sorry that was due to the previous PR (that fixed a test) hasn't been merged into develop and into this branch; this time the tests should pass (except for 3.7) 🤞

@mike-gangl mike-gangl merged commit c52fcf6 into develop Mar 13, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

-gr option does not work with data files with multiple extensions such as .nc.gz
3 participants